class LexerError(Exception):
    def __init__(self, c, line, pos ):
        super(LexerError, self).__init__("Illegal character '%s' in line '%s' column '%s'" % (c, str(line), str(pos)))
        self.c = c
        self.line = line
        self.pos = pos


class ParserError(Exception):
    def __init__(self, token, line, pos ):
        super(ParserError, self).__init__("Illegal token '%s' in line '%s' column '%s'" % (token, str(line), str(pos)))
        self.token = token
        self.line = line
        self.pos = pos


class LanguageError(Exception):
    def __init__(self, message, line):
        super(LanguageError, self).__init__("%s at line '%s'" % (message, str(line)))
        self.message = message
        self.line = line


class CompilerError(Exception):
    def __init__(self, message):
        super(CompilerError, self).__init__(message)
